﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="HisFin002.aspx.cs" Inherits="Admin_HisFin_HisFin002" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" Runat="Server">
    <link href="../../Plugin/font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js""></script>
    <style type="text/css">
        .subTable
        {
            border: none !important;
        }

            .subTable td
            {
                border: none !important;
                padding-right: 8px;
            }
    </style>
    <script type="text/javascript">
        function searchDiv() {
            $("#tbSearch").toggle("fast");
            if ($("#divButton").hasClass("open")) {
                $("#divButton").removeClass("open");
                $("#divButton").addClass("close")
            }
            else {
                $("#divButton").removeClass("close");
                $("#divButton").addClass("open")
            }

        }
    </script>
    <script type="text/javascript">
        function PrintLabel() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 8) {
                alert('选择的记录数不能超过8条。(当前选择：' + checkList.length + '条)');
                return;
            }
            if (checkList.length > 0) {
                var ids = "";
                checkList.each(function () {
                    ids += $(this).parent().attr("data-boxid") + ",";
                });

                OpenWindow('标签打印', 'P', '/Admin/NoSAPFin/NoSAPFin002b.aspx?type=P&boxids=' + ids, 1200, 740)
            }
            else {
                alert("请选择您要打印的凭证盒标签!");
            }
        }
        function BatEdit() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 30) {
                alert('选择的记录数不能超过30条。(当前选择：' + checkList.length + '条)');
                return;
            }
            if (checkList.length > 0) {
                var ids = "";
                checkList.each(function () {
                    ids += $(this).parent().attr("data-boxid") + ",";
                });

                OpenWindow('批量编辑', 'U', '/Admin/NoSAPFin/NoSAPFin002P.aspx?type=P&boxids=' + ids, 1200, 740)
            }
            else {
                alert("请选择您要批量编辑的凭证!");
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%; min-width: 700px">
            <div class="searchBox">
                <div class="sb1">搜索条件</div>
                <div class="sb2 close" onclick="searchDiv()" id="divButton"></div>
            <table width="100%" cellspacing="2" cellpadding="2" id="tbSearch">
                <tr>
                    <td>凭证盒条码:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtBoxNo" runat="server"></yncWeb:yncTextBox>
                    </td>
                    <td>外仓条形码:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtSupplierBoxNo" runat="server"></yncWeb:yncTextBox>
                    </td>
                </tr> 
                <tr>
                    <td>文档描述:</td>
                    <td>
                        <yncWebDDL:DrpCodeTable ID="drpVoucherDescription" runat="server" Category="CTE006" ShowSelectedItem="true"  Required="true">
                         </yncWebDDL:DrpCodeTable>
                    </td>
                    <td width="100px">
                        初次入库日期:
                    </td>
                    <td>
                       <span style="color: #000;">
                        <input class="Wdate textBox" style="width: 180px;" runat="server" readonly="readonly"
                        type="text" id="txtStoreStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtStoreEndDate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                        <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtStoreEndDate"
                        clientidmode="Static" style="width: 180px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStoreStartDate\');}',maxDate:'9998-12-31'})" />
                       </span>
                    </td>
                </tr>
                <tr>
                    <td width="100px">
                        文档日期:
                    </td>
                    <td colspan="3">
                        <yncWebDDL:DrpYear ID="drpHisDocumentYearStart" runat="server" Required="true">
                        </yncWebDDL:DrpYear>
                        <yncWebDDL:DrpMonth ID="drpHisDocumentMonthStart" runat="server" Required="true">
                        </yncWebDDL:DrpMonth>
                        <yncWebDDL:DrpDay ID="drpHisDocumentDayStart" runat="server" Required="true">
                        </yncWebDDL:DrpDay>
                        - 
                           <yncWebDDL:DrpYear ID="drpHisDocumentYearEnd" runat="server" Required="true">
                           </yncWebDDL:DrpYear>
                        <yncWebDDL:DrpMonth ID="drpHisDocumentMonthEnd" runat="server" Required="true">
                        </yncWebDDL:DrpMonth>
                        <yncWebDDL:DrpDay ID="drpHisDocumentDayEnd" runat="server" Required="true">
                        </yncWebDDL:DrpDay>
                    </td>
                </tr>
                <tr>
                    <td>凭证号:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtKeyStart" runat="server"></yncWeb:yncTextBox> - <yncWeb:yncTextBox ID="txtKeyEnd" runat="server"></yncWeb:yncTextBox>
                    </td>
                    <td>是否删除:</td>
                    <td>
                        <yncWebDDL:DropDownListBase ID="drpIsDelete" runat="server">
                            <asp:ListItem Value="" Text="请选择"></asp:ListItem>
                            <asp:ListItem Value="1" Text="已删除"></asp:ListItem>
                            <asp:ListItem Value="0" Selected="True" Text="未删除"></asp:ListItem>
                        </yncWebDDL:DropDownListBase>
                    </td>
                </tr>
                <tr>
                    <td>公司:</td>
                    <td>
                        <yncWebDDL:DrpCompany ID="drpCompany" runat="server" Required="true"  ShowSelectedItem="true">
                        </yncWebDDL:DrpCompany>
                    </td>
                    <td>职能部门:</td>
                    <td>
                        <yncWebDDL:DrpCodeTable ID="drpFunctionDept" runat="server" Category="CTE001" Required="true" ShowSelectedItem="true">
                        </yncWebDDL:DrpCodeTable>
                    </td>
                </tr>
                <tr>
                    
                </tr>
                <tr>
                    <td width="100px">
                        录入时间:
                    </td>
                    <td>
                       <span style="color: #000;">
                    <input class="Wdate textBox" style="width: 180px;" runat="server" readonly="readonly"
                        type="text" id="txtStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                    <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtEndate"
                        clientidmode="Static" style="width: 180px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\');}',maxDate:'9998-12-31'})" />
                </span>
                   
                    </td>
                    <td>凭证负责人:</td>
                    <td>
                        <yncWebDDL:DrpUsers ID="drpManageUser" runat="server" Required="true" ShowSelectedItem="true">
                </yncWebDDL:DrpUsers>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="left">
                        <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <%--<table width="100%" cellspacing="2" cellpadding="2" class="menu" align="left" style="margin-top:10px;">
            <td style="width:3px;">
                &nbsp;
            </td>
            <td class="td">
                <a class="edit" onclick="BatEdit()" href="#">批量修改</a>
                <a class="print" onclick="PrintLabel()" href="#">标签打印</a>
            </td>
        </table>--%>
        <yncWeb:PagnationGrid PageSize="100" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="2080px" cellspacing="0" cellpadding="0" class="pagnationtable" align="left" style="table-layout:fixed">
                    <thead>
                        <tr>
                            <th width="60px"><asp:CheckBox ID="chk_sel_all" ClientIDMode="Static" runat="server" Text="序号" />
                            </th>
                            <th width="40px">操作
                            </th>
                            <th width="40px">SAP?</th>
                            <th width="90px">凭证盒条码
                            </th>
                            <th width="90px">外仓条形码
                            </th>
                            <th width="110px">文档描述
                            </th>
                            <th width="150px">凭证索引号
                            </th>
                            <th width="110px">文档日期
                            </th>
                            <th width="70px">文档数量
                            </th>
                            <th width="100px">公司名称
                            </th>
                            <th width="100px">公司代码
                            </th>
                            <th width="100px">职能部门
                            </th>
                            <th width="100px">实物存储状态
                            </th>
                            <th width="100px">实物存储地点
                            </th>
                            <th width="100px">电子存储状态
                            </th>
                            <th width="100px">电子存储地点
                            </th>
                            <th width="100px">初次入库日期
                            </th>
                            <th width="100px">负责人
                            </th>
                            <th width="100px">录入人
                            </th>
                            <th width="100px">已保管期限
                            </th>
                            <th width="100px">应保管期限
                            </th>
                            <th width="100px">销毁时间
                            </th>
                            <th width="100px">备注
                            </th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td class="sel_class">
                        <%# Container.ItemIndex +1 %> <asp:CheckBox ID="chk_sel"  data-recount="<%# Eval(FinBoxMetadata.ColumnNames.NoSapReceiptCount)%>" class="sel_class" runat="server" data-boxid="<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>"/>
                        <asp:Label ID="lbBoxID" runat="server" Visible="false" Text = "<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>"></asp:Label>
                    </td>
                    <td align="center">
                        <a class="aEdit" Style='<%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>' title="编辑" 
                            href="javascript:OpenWindow('修改','U','/Admin/NoSAPFin/HisFin002a.aspx?type=U&BoxId=<%#Eval(FinBoxMetadata.ColumnNames.BoxID)%>&ReceiptID=<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>',1000,800)"></a>
                        <asp:LinkButton ToolTip="删除" runat="server" ID="LinkButtonDelete" CssClass="aDelete" Style='<%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>'
                                            OnClientClick="return confirm('是否确定要删除此凭证？')" OnCommand="Delete_Command"
                                            CommandArgument='<%#Eval(FinReceiptMetadata.ColumnNames.ReceiptID)%>'></asp:LinkButton>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        NoSap
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinBoxMetadata.ColumnNames.BoxNo)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinBoxMetadata.ColumnNames.SupplierBoxNo)%>
                    </td>                    
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval("VoucherDescriptionName")%>
                    </td>
                     <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.HisIndexStart)%> - <%# Eval(FinReceiptMetadata.ColumnNames.HisIndexEnd)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.HisDocumentStartDate)%> - <%# Eval(FinReceiptMetadata.ColumnNames.HisDocumentEndDate)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinBoxMetadata.ColumnNames.NoSapReceiptCount)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.CompanyName)%>

                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.CompanyCode)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.FunctionDept+"Name")%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.StorageStatus+"Name")%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(BFThirdUnitMetadata.ColumnNames.Name)%><%# Eval(BFThirdUnitMetadata.ColumnNames.CartName)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval("EStorageStatusName")%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.EStorageLocation)%>
                    </td>                  
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.FirstStorageDate).FormatDate(ConstantValue.DateFormat)%>
                    </td>                    
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.ManageUser)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.CreatedBy)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#getYear(Eval(FinReceiptMetadata.ColumnNames.StoreStartDate))%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.NeedStoreYear)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%#Eval(FinReceiptMetadata.ColumnNames.DestoryDate).FormatDate(ConstantValue.DateFormat)%>
                    </td>
                    <td <%#Eval(FinReceiptMetadata.ColumnNames.IsDeleted).ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinReceiptMetadata.ColumnNames.Comments)%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>
    </div>

    <script type="text/javascript">
        $("#tbSearch").hide();
    </script>
    <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/Controls/chosen.jquery.min.js")%>"></script>    
    <script type="text/javascript">
        $(function () {
            $("#<%=drpManageUser.ClientID %>").css('width', '212px').chosen({
                max_selected_options: 1,
                no_results_text: "No Datas",
                search_contains: true,
                allow_single_deselect: false
            });
        });
    </script>  

    <script type="text/javascript">
        function showMsg() {
            alert("NoSAP财务凭证信息删除成功！");
            window.location.href = window.location.href;
            //location.reload();
        }
    </script>  
</asp:Content>


